package consts

import (
	"hotgo/internal/library/dict"
	"hotgo/internal/model"
)

func init() {
	dict.RegisterEnums("distributionStatus", "分销状态", DistributionStatusOptions)
	dict.RegisterEnums("distributionType", "分销类型", DistributionTypeOptions)
	dict.RegisterEnums("distributionDetailType", "分销详情类型", DistributionDetailTypeOptions)
}

const (
	DistributionStatusCreate = iota
	DistributionStatusProcessing
	DistributionStatusComplete
	DistributionStatusFail
)

// DistributionStatusOptions 分销状态选项
var DistributionStatusOptions = []*model.Option{
	dict.GenDefaultOption(DistributionStatusCreate, "待处理"),
	dict.GenWarningOption(DistributionStatusProcessing, "处理中"),
	dict.GenSuccessOption(DistributionStatusComplete, "完成"),
	dict.GenErrorOption(DistributionStatusFail, "失败"),
}

const (
	DistributionEventProcessing = "to_processing" // 处理中
	DistributionEventComplete   = "to_complete"   // 完成
	DistributionEventFail       = "to_fail"       // 失败
)

const (
	DistributionTypeProduct = iota
	DistributionTypeVip
)

var DistributionTypeOptions = []*model.Option{
	dict.GenDefaultOption(DistributionTypeProduct, "商品分销"),
	dict.GenDefaultOption(DistributionTypeVip, "会员分销"),
}

const (
	DistributionUnknown        = iota // 未知
	DistributionUserBindSaleKr        // 用户绑定销客
	DistributionProductSaleKr         // 商品绑定销氪
	DistributionFee                   // 手续费
	DistributionVipShare              // 会员分享
	DistributionBuyVip                // 购买会员
	DistributionBuySaleKr             // 购买销氪
	DistributionBuyService            // 购买服务商
	DistributionToCompany             // 公司
)

var DistributionDetailTypeOptions = []*model.Option{
	dict.GenDefaultOption(DistributionUnknown, "未知"),
	dict.GenInfoOption(DistributionUserBindSaleKr, "用户绑定销客"),
	dict.GenInfoOption(DistributionProductSaleKr, "商品绑定销氪"),
	dict.GenInfoOption(DistributionVipShare, "会员分享"),
	dict.GenWarningOption(DistributionFee, "手续费"),
	dict.GenSuccessOption(DistributionBuyVip, "购买会员"),
	dict.GenSuccessOption(DistributionBuySaleKr, "购买销氪"),
	dict.GenSuccessOption(DistributionBuyService, "购买服务商"),
	dict.GenWarningOption(DistributionToCompany, "公司"),
}
